﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutboundValidationRule.aspx.cs" Inherits="WMS6.Web.Configuration.OutboundValidationRule" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>OutboundValidationRule</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />
    <script src="../Js/jquery.js" type="text/javascript"></script>
    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>
    <script src="../Js/util.js" id="js" type="text/javascript"></script>
    <script src="../Js/InitPage.js" type="text/javascript"></script>    
    <script src="../Js/checkbox.js" type="text/javascript"></script>    
    
    <script type="text/javascript">
        //初始化页面
        window.onload = function(){
            initEditNewPage();
        }
        
        function newPutawayRule()
        {
            var from = document.getElementById("hdnFrom").value;
            window.location.href = "OutboundValidationRule.aspx?from="+escape(from);
            return false;
        }
        
        function confirmMsg(code)
        {
            if(code == "C001")
            {
                if(confirm('<%=GetGlobalMsgResource("C001") %>'))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else if(code == "C010")
            {
                if(confirm('<%=GetGlobalMsgResource("C010") %>'))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else if (code == "F2410_001")
            {
                if (confirm('<%=GetGlobalMsgResource("F2410_001") %>'))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }

        }
           //弹出窗口选择货主
        function selectOwner()
        {
            var rtnValue = popModalWindow('../Configuration/OwnerQuery.aspx?action=txtOwnerID','dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if(rtnValue != null && rtnValue.toString() != "")
            {
                document.getElementById("txtOwnerID").focus();
                document.getElementById("txtOwnerID").value = rtnValue;
            }
        }
        
        //弹出窗口选择货品
        function selectSku()
        {       
            var rtnValue = popModalWindow('../Configuration/SkuQuery.aspx?action=txtSkuID&type=OwnerID&ownerID=' + escape(document.getElementById("txtOwnerID").value), 'dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if(rtnValue != null && rtnValue.toString() != "")
            {          rtnValue= rtnValue.split('@_@');
                document.getElementById("txtSkuID").value = rtnValue[0];
                if( document.getElementById("txtOwnerID").value  =="")
                {
                    document.getElementById("txtOwnerID").value =rtnValue[1];
                }
            }
            
        }
        
        //弹出收货人代码
        function selectConsigneeID() 
        {
             var rtnValue = popModalWindow('../Configuration/CustomerQuery.aspx?action=txtCustomerID', 'dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');

            if(rtnValue != null && rtnValue.toString() != "")
            {
                document.getElementById("txtCustomerID").focus();
                document.getElementById("txtCustomerID").value = rtnValue;
            }

        }
        
   </script>     
</head>
<body>
    <form id="F2206" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="div_top">
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:Label ID="lblArea" runat="server" CssClass="label_header" Text="出库验证规则" meta:resourcekey="lblArea"></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnGoBack" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnGoBack%>"
                            Enabled="false" OnClientClick="javascript:window.history.go(-1); return false;"/>
                    </td>
                    <td>
                        <asp:Button ID="btnNew" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnNew%>"
                            Enabled="false" AccessKey="n" OnClientClick="newPutawayRule(); return false;" />
                    </td>
                    <td>
                        <asp:Button ID="btnSave" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnSave%>"
                            Enabled="false" AccessKey="s"  OnClick="btnSave_Click"/>
                    </td>
                    <td>
                        <asp:Button ID="btnDelete" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnDelete%>"
                            Enabled="false" AccessKey="d" OnClientClick="javascript:if(confirmMsg('C001')) return true; else return false;" OnClick="btnDelete_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnCopy" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnCopy%>"
                            Enabled="false" AccessKey="c"  />
                    </td>
                </tr>
            </table>
        </div>
        <asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>
                <div>
                    <asp:Label ID="lblMsg" runat="server" CssClass="label_message" meta:resourcekey="lblMsg"></asp:Label>
                </div>
                <div id="div_menu">
                    <div style="float: left; width: 8px;">
                        <div class="tabL" id="divL1">
                        </div>
                    </div>
                    <div style="float: left;" class="tabLabelCont tabCur" onclick="setTab('one',1,2)"
                        id="divM1">
                        <asp:Label ID="one1" CssClass="hover" runat="server" meta:resourcekey="one1">常规</asp:Label></div>
                    <div style="float: left; margin-right: 2px;">
                        <div class="tabR" id="divR1">
                        </div>
                    </div>
                    <div style="float: left; width: 8px;">
                        <div class="tabL_1" id="divL2">
                        </div>
                    </div>
                    <div style="float: left;" class="tabLabelCont tabCur_1" onclick="setTab('one',2,2);"
                        id="divM2">
                        <asp:Label ID="one2" CssClass="navigationlabel" runat="server" meta:resourcekey="one2">&nbsp;明细&nbsp;</asp:Label></div>
                    <div style="float: left; margin-right: 2px;">
                        <div class="tabR_1" id="divR2">
                        </div>
                    </div>
                </div>
                <div id="div_content">
                    <div id="con_one_1" style="display: block;">
                        <table width="720px" style="display: block; margin-left: 10px; margin-top: 10px;">
                            <tr>
                                <td width="180">
                                    <asp:Label ID="lblOutboundValidationRuleID" runat="server" CssClass="label" Text="出库验证规则代码" ></asp:Label><span
                                        class="must_input">*</span>
                                </td>
                                <td width="180">
                                    <asp:Label ID="lblType" runat="server" CssClass="label" Text="类型" ></asp:Label>
                                </td>
                                <td width="180">
                                    <asp:Label ID="lblOwnerID" runat="server" CssClass="label" Text="货主" ></asp:Label><span
                                        class="must_input">*</span>
                                </td>
                                <td width="180">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtOutboundValidationID" runat="server" CssClass="textbox" MaxLength="20"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlType" runat="server" CssClass="mediumselectbox" >
                                       
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtOwnerID" runat="server" CssClass="textbox"></asp:TextBox><img
                                        src="../Images/icon_find.gif" id="imgOwnerID" runat="server" alt="select one item"
                                        class="img" onclick="selectOwner();" />
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="180">
                                    <asp:Label ID="lblPutawayRuleDescr" runat="server" CssClass="label" Text="描述" meta:resourcekey="lblPutawayRuleDescr"></asp:Label>
                                </td>
                                <td width="180">
                                    &nbsp;
                                </td>
                                <td width="180">
                                    <asp:Label ID="lblCustomerID" runat="server" CssClass="label" Text="客户" ></asp:Label><span
                                        class="must_input">*</span>
                                </td>
                                <td width="180">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:TextBox ID="txtPutawayRuleDescr" runat="server" CssClass="largetextbox" MaxLength="50"
                                        meta:resourcekey="txtPutawayRuleDescr"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtCustomerID" runat="server" CssClass="textbox"></asp:TextBox><img
                                        src="../Images/icon_find.gif" id="img1" runat="server" alt="select one item"
                                        class="img" onclick="selectConsigneeID();" />
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td><asp:Label ID="lblMinSafeDays" runat="server" CssClass="label" Text="最小保质期天数" ></asp:Label></td>
                                <td></td>
                                <td><asp:Label ID="lblSkuID" runat="server" CssClass="label" Text="货品" ></asp:Label><span
                                        class="must_input">*</span></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td><asp:TextBox ID="txtMinSafeDays" runat="server" CssClass="textbox"></asp:TextBox></td>
                                <td></td>
                                <td><asp:TextBox ID="txtSkuID" runat="server" CssClass="textbox"></asp:TextBox><img
                                            src="../Images/icon_find.gif" alt="select one item" class="img" onclick="selectSku();" /></td>
                                <td></td>
                            </tr>
                            <tr style="height: 10px;">
                                <td width="180">
                                </td>
                                <td width="180">
                                </td>
                                <td width="180">
                                </td>
                                <td width="180">
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:CheckBox ID="chkIsActive" runat="server" CssClass="checkbox" Text="启用" Checked="True" />
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:CheckBox ID="chkSysCreated" runat="server" CssClass="checkbox" Text="系统创建" Enabled="False" />
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="con_one_2" style="display: none;">
                        <table width="760px" style="display: block; margin-left: 10px; margin-top: 10px;">
                            <tr>
                                <td>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Button ID="btnAddDetail" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnAddDetail%>"
                                                    Enabled="False" OnClientClick="javascript:if(document.getElementById('hdnValidationRuleID').value == ''){if(confirm(' 出库验证规则主信息尚未保存,是否继续? 继续则自动保存主信息!')) { return true;} else {  return false;}}" OnClick="btnAddDetail_Click" />
                                            </td>
                                            <td>
                                                <asp:Button ID="btnDeleteDetail" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnDeleteDetail%>"
                                                    Enabled="False" OnClientClick="javascript:if(confirmMsg('C010')) return true; else return false;"  OnClick="btnDeleteDetail_Click" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr style="height: 10px;">
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div>
                                        <asp:GridView ID="gvOutboundValidationRuleDetail" runat="server" AllowSorting="True" AutoGenerateColumns="False" OnRowDataBound="gvOutboundValidationRuleDetail_RowDataBound"
                                            CssClass="gridview" DataKeyNames="ValidationID,SeqNo" >
                                            <FooterStyle CssClass="GridViewFooterStyle" />
                                            <RowStyle CssClass="GridViewRowStyle" />
                                            <HeaderStyle CssClass="GridViewHeaderStyle" />
                                            <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                            <Columns>
                                                <asp:BoundField HeaderText="序号" FooterText="序号" meta:resourcekey="BoundField">
                                                    <ItemStyle CssClass="GridViewRowWidth_40" />
                                                </asp:BoundField>
                                                <asp:TemplateField meta:resourcekey="TemplateField">
                                                    <HeaderTemplate>
                                                        <asp:CheckBox ID="CheckBox1" runat="server" onclick="selectAll(this,'gvOutboundValidationRuleDetail');"
                                                            meta:resourcekey="CheckBox1" />
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chbSelect" runat="server" meta:resourcekey="chbSelect" />
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        <asp:CheckBox ID="CheckBox2" runat="server" onclick="selectAll(this,'gvOutboundValidationRuleDetail');"
                                                            meta:resourcekey="CheckBox2" />
                                                    </FooterTemplate>
                                                    <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                                                    <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="明细" FooterText="明细" meta:resourcekey="TemplateFieldResource2">
                                                    <ItemTemplate>
                                                        <a href='<%# FormatUrl("OutboundValidationRuleDetail.aspx?type=edit&from=list&ID={0}&SeqNO={1}",Eval("ValidationID").ToString(),Eval("SeqNo").ToString()) %>'
                                                            target="_self">
                                                            <img src="../Images/icon_edit.gif" class="img" style="border: none 0px blue;" alt="receipt" /></a>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="GridViewRowWidth_50" HorizontalAlign="Center" />
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="SeqNo" HeaderText="行号" FooterText="行号" SortExpression="SeqNo"
                                                    meta:resourcekey="LineID">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="ValidationRoutine" HeaderText="验证程序" FooterText="验证程序" SortExpression="ValidationRoutine"
                                                    meta:resourcekey="ValidationRoutine">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="IsActive" HeaderText="启用" FooterText="启用" SortExpression="IsActive"
                                                    meta:resourcekey="IsActive">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="RfDirectedPick" HeaderText="RF指令拣货" FooterText="RF指令拣货" SortExpression="RfDirectedPick"
                                                    meta:resourcekey="ToLoc">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="RfAssistedPick" HeaderText="RF辅助拣货" FooterText="RF辅助拣货" SortExpression="RfAssistedPick" >
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                            </Columns>
                                        </asp:GridView>
                                    </div>
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <input type="hidden" id="hdnSeqNo" runat="server"></input>
                    <input id="hdnValidationRuleID" runat="server" type="hidden"></input>
                    <input id="hdnFlag" runat="server" type="hidden" value="0"></input>
                     
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <input type="hidden" id="hdnFrom" runat="server" />
    </form>
</body>
</html>
